The invention relates generally to managing files in a computer system, and, more particularly, relates to placing a marker in a first file that an application has been directed to open in order to redirect the application to instead open a second file.
An HTML document typically comprises a primary file in HTML format and zero or more associated supporting files. A supporting file can be embedded in the primary file and can represent embedded content of the primary file. A supporting file can be in HTML format or some other file format.
Some editing environments allow the user to edit an HTML document by selecting and editing the individual files that together form the HTML document. To enable the user to choose which file to select and edit, the user is presented with a raw directory of individual files.
The drawback of these editing environments is that the editing model is based on the expectation that the user has an understanding of the HTML document""s file structure. If a user wants to modify an aspect of an HTML document, the user must know both the name and location of the file that pertains to that aspect of the HTML document in order to select that file for editing. Many users, however, are not aware of their HTML document""s file structure. As an HTML document may be composed of many files, a user who knew the file structure details of an HTML document at the time the user created the document is likely to forget them by a later time when he attempts to modify the HTML document. A user who wishes to edit an HTML document typically opens several files in the raw directory presented to him until, by trial and error, he finds the desired file.
U.S. patent application Ser. No. 09/233,991, pending, assigned to the assignee of the present application, teaches an improved editing environment for managing embedded content in HTML documents. In an improved editing environment, the user creates an HTML document in the editing environment without a need to know the file structure details of storing the HTML document. To the user, the HTML document appears to be one seamless file in the editing environment. In response to the user creating an HTML document in this improved editing environment, however, the editing environment creates supporting files to represent much of the content of the HTML document. These supporting files are then embedded in a primary file by the editing environment, and the files associated with the HTML document can be saved.
When the improved editing environment opens the primary file of an HTML document at a later time, the editing environment can use the described file structure to recreate the original editing experience for the user without requiring the user to know any details of the HTML document""s file structure. In other words, the editing environment recreates for the user the impression that there is only one seamless file to edit.
However, many users are not aware of the distinction between primary files and supporting files. If a user instructs the improved editing environment to open a supporting file instead of a primary file when presented with a raw directory of files, the editing environment has no way of knowing that the chosen file is a supporting file. The editing environment in this case opens for editing only the supporting file that was chosen. This typically leads to confusion on the part of the user if the user is not aware of the HTML document""s file structure. The user may be confused because the user expects to see the entire HTML document, just as he did during the original document creation experience.
Therefore, there is a need in the art for an editing environment that enables a user to edit an HTML document without requiring that the user understand the HTML document""s file structure.
The present invention meets the need for an improved editing environment by allowing an editing environment to open a primary file instead of an associated supporting file that the editing environment has been instructed to open. If the primary and supporting files are part of an HTML document, then redirecting an editing environment to the primary file allows the editing environment to present for editing the entire content of the HTML document.
Generally described, the invention is a computer-implemented method for opening a file. A file open event for opening the file is detected. In response to the file open event, an inquiry is conducted to determine if the file has a marker or tag indicating that the file is a supporting file. If the file has a marker indicating that the file is a supporting file, the primary file with which the supporting file is associated is opened instead.
The primary file can be opened in an editing environment or in a different application. According to an aspect of the invention, the marker can be placed in the supporting file in response to a file save event for saving the supporting file. The marker may also provide the location of the primary file.
The primary file and the supporting file may be part of an HTML document. An HTML document typically comprises a primary file in HTML format and zero or more associated supporting files. A supporting file can be embedded in the primary file and can represent embedded content of the primary file. A supporting file can be in HTML format or some other file format.
If the supporting file of an HTML document is in HTML format, it can be provided with a marker in the form of a  less than link greater than  tag placed in the  less than head greater than  section of the supporting file. The  less than link greater than  tag can have the following format:
 less than link id=Main-file rel=Main-File href=xe2x80x9cRelURIxe2x80x9d greater than ,
where xe2x80x9cRelURIxe2x80x9d is a relative URI specifying the location of a primary file relative to the supporting file.